-
Notifications
You must be signed in to change notification settings - Fork 32
🐛 Celery tasks aborted after submission #8371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Celery tasks aborted after submission #8371
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug in Celery task submission by reordering operations and adding proper error handling to prevent orphaned task records in the task store.
- Moves task store creation after Celery task submission
- Adds exception handling to clean up task store records if submission fails
- Ensures task store consistency by removing records when Celery submission fails
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8371 +/- ##
==========================================
+ Coverage 87.86% 89.76% +1.90%
==========================================
Files 1947 1331 -616
Lines 75663 56246 -19417
Branches 1322 203 -1119
==========================================
- Hits 66484 50492 -15992
+ Misses 8782 5687 -3095
+ Partials 397 67 -330
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
GitHK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
sanderegg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this fix the issue we see currently in master(s)?
🧪 CI InsightsHere's what we observed from your CI run for 33abdf1. ✅ Passed Jobs With Interesting Signals
|
|
@Mergifyio queue |
🟠 Waiting for conditions to match
|
…o/osparc-simcore into fix-celery-task-submission
sanderegg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
pcrespov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, i do not want to hold this PR more ...
IMO the logger.exception is not really necessary and should be caller that logs the exception raised.
In short: in general do not log.exception if you are raising it, instead create a new custom exception and append extra context and reraise. Whoever full handles it (i.e. does not re-reaise it) will get a very rich context of what happened and cant take action.
|
@Mergifyio queue |
🛑 Configuration not compatible with a branch protection settingThe branch protection setting |
bisgaard-itis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix
|
4600d77
into
ITISFoundation:master



What do these changes do?
This PR fixes a bug in Celery task submission by reordering operations and adding proper error handling to prevent orphaned task records in the task store.
In some cases, the task record hadn't been written yet, and the task had been executed by the worker. This caused a premature abort due to the new
abort_monitormechanism.Related issue/s
How to test
Dev-ops